package com.lyeducation.entities.middle;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "sys_role_user", schema = "db_wsfpro", catalog = "")
@IdClass(SysRoleUserEntityPK.class)
public class SysRoleUserEntity implements Serializable {
  private String userId;
  private String roleId;
  private Timestamp createTime;

  @Id
  @Column(name = "userId", nullable = false, length = 18)
  public String getUserId() {
    return userId;
  }

  public void setUserId(String userId) {
    this.userId = userId;
  }

  @Id
  @Column(name = "roleId", nullable = false, length = 18)
  public String getRoleId() {
    return roleId;
  }

  public void setRoleId(String roleId) {
    this.roleId = roleId;
  }

  @Basic
  @Column(name = "createTime", nullable = true)
  public Timestamp getCreateTime() {
    return createTime;
  }

  public void setCreateTime(Timestamp createTime) {
    this.createTime = createTime;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    SysRoleUserEntity that = (SysRoleUserEntity) o;
    return Objects.equals(userId, that.userId)
        && Objects.equals(roleId, that.roleId)
        && Objects.equals(createTime, that.createTime);
  }

  @Override
  public int hashCode() {

    return Objects.hash(userId, roleId, createTime);
  }
}
